import pygame
import sys

from pygame_test.MoveRect import MoveRect


class Pyinit:
    def __init__(self):
        self.rect = MoveRect(100, 200, 90, 90, (244, 116, 33), 2, False)

    def start(self, winx, winy, fps):
        pygame.init()
        self.screen = pygame.display.set_mode((winx, winy))
        fclock = pygame.time.Clock()
        d = 1
        while True:
            self.screen.fill((0,0,0))
            self.rect.set_w(self.rect.w / d)
            self.rect.set_h(self.rect.h / d)
            self.rect.draw(self.screen)
            self.event_handler()
            pygame.display.update()
            fclock.tick(fps)
            d += 0.1

    def event_handler(self):
        for e in pygame.event.get():
            if e.type == pygame.QUIT:
                pygame.quit()
                sys.exit()


if __name__ == '__main__':
    pyinit = Pyinit()
    pyinit.start(300, 400, 1)
